package com.wicket.okrapp.web.contorller;
import com.wicket.okrapp.biz.service.dto.req.*;
import com.wicket.okrapp.biz.service.dto.res.*;
import com.wicket.okrapp.biz.service.TargetTempService;
import com.wicket.okrapp.common.ro.OkrResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/app/targetTemp/")
public class TargetTempController {
    @Autowired
    TargetTempService  targetTempService;
/**
   * D3-1查指标模板详情(公共)
   */
    @PostMapping("queryTargetTempDetailCom")
    public OkrResult<QueryTargetTempDetailComRespDto> queryTargetTempDetailCom(@RequestBody @Validated QueryTargetTempDetailComReqDto reqDTO){
    return OkrResult.success(targetTempService.queryTargetTempDetailCom(reqDTO));
    }
/**
   * D3-1查标签关系下指标模板列表
   */
    @PostMapping("queryTagRelTargetTempList")
    public OkrResult<QueryTagRelTargetTempListRespDto> queryTagRelTargetTempList(@RequestBody @Validated QueryTagRelTargetTempListReqDto reqDTO){
    //Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryTagRelTargetTempListRespDto retData = targetTempService.queryTagRelTargetTempList(reqDTO);

//        retData.setPageNum(page.getPageNum());
//        retData.setPageSize(page.getPageSize());
//        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }
/**
   * D3-1查指标模板列表
   */
    @PostMapping("queryTargetTempList")
    public OkrResult<QueryTargetTempListRespDto> queryTargetTempList(@RequestBody @Validated QueryTargetTempListReqDto reqDTO){
    //Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryTargetTempListRespDto retData = targetTempService.queryTargetTempList(reqDTO);

//        retData.setPageNum(page.getPageNum());
//        retData.setPageSize(page.getPageSize());
//        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }
/**
   * D3-1查指标模板详情
   */
    @PostMapping("queryTargetTempDetail")
    public OkrResult<QueryTargetTempDetailRespDto> queryTargetTempDetail(@RequestBody @Validated QueryTargetTempDetailReqDto reqDTO){
    return OkrResult.success(targetTempService.queryTargetTempDetail(reqDTO));
    }
/**
   * D3-1新增指标模板
   */
    @PostMapping("addTargetTemp")
    public OkrResult<AddTargetTempRespDto> addTargetTemp(@RequestBody @Validated AddTargetTempReqDto reqDTO){
    return OkrResult.success(targetTempService.addTargetTemp(reqDTO));
    }
/**
   * D3-1修改指标模板
   */
    @PostMapping("updateTargetTemp")
    public OkrResult<UpdateTargetTempRespDto> updateTargetTemp(@RequestBody @Validated UpdateTargetTempReqDto reqDTO){
    return OkrResult.success(targetTempService.updateTargetTemp(reqDTO));
    }
/**
   * D3-1新增牵头部门的指标模板
   */
    @PostMapping("addLeadDeptTargetTemp")
    public OkrResult<AddLeadDeptTargetTempRespDto> addLeadDeptTargetTemp(@RequestBody @Validated AddLeadDeptTargetTempReqDto reqDTO){
    return OkrResult.success(targetTempService.addLeadDeptTargetTemp(reqDTO));
    }
/**
   * D3-1删除牵头部门的指标模板
   */
    @PostMapping("deleteLeadDeptTargetTemp")
    public OkrResult<DeleteLeadDeptTargetTempRespDto> deleteLeadDeptTargetTemp(@RequestBody @Validated DeleteLeadDeptTargetTempReqDto reqDTO){
    return OkrResult.success(targetTempService.deleteLeadDeptTargetTemp(reqDTO));
    }
/**
   * D3-1检查删除牵头部门的指标模板条件
   */
    @PostMapping("checkLeadDeptTargetTemp")
    public OkrResult<CheckLeadDeptTargetTempRespDto> checkLeadDeptTargetTemp(@RequestBody @Validated CheckLeadDeptTargetTempReqDto reqDTO){
    return OkrResult.success(targetTempService.checkLeadDeptTargetTemp(reqDTO));
    }
/**
   * D3-2删除指标模板
   */
    @PostMapping("deleteTargetTemp")
    public OkrResult<DeleteTargetTempRespDto> deleteTargetTemp(@RequestBody @Validated DeleteTargetTempReqDto reqDTO){
    return OkrResult.success(targetTempService.deleteTargetTemp(reqDTO));
    }
/**
   * D3-2存档指标模板
   */
    @PostMapping("archiveTargetTemp")
    public OkrResult<ArchiveTargetTempRespDto> archiveTargetTemp(@RequestBody @Validated ArchiveTargetTempReqDto reqDTO){
    return OkrResult.success(targetTempService.archiveTargetTemp(reqDTO));
    }
/**
   * D3-2撤销存档指标模板
   */
    @PostMapping("undoArchiveTargetTemp")
    public OkrResult<UndoArchiveTargetTempRespDto> undoArchiveTargetTemp(@RequestBody @Validated UndoArchiveTargetTempReqDto reqDTO){
    return OkrResult.success(targetTempService.undoArchiveTargetTemp(reqDTO));
    }
/**
   * D3-1查询编辑的指标模板
   */
    @PostMapping("queryEditTargetTempDetail")
    public OkrResult<QueryEditTargetTempDetailRespDto> queryEditTargetTempDetail(@RequestBody @Validated QueryEditTargetTempDetailReqDto reqDTO){
    return OkrResult.success(targetTempService.queryEditTargetTempDetail(reqDTO));
    }
/**
   * D3执行指标模板类型等信息分析(公共)
   */
    @PostMapping("implementTargetTempTypeEtcAnalyseCom")
    public OkrResult<ImplementTargetTempTypeEtcAnalyseComRespDto> implementTargetTempTypeEtcAnalyseCom(@RequestBody @Validated ImplementTargetTempTypeEtcAnalyseComReqDto reqDTO){
    return OkrResult.success(targetTempService.implementTargetTempTypeEtcAnalyseCom(reqDTO));
    }
/**
   * D3异步发布自动锁定指标模板(公共)
   */
    @PostMapping("implementAsyncPublishAutoLockObjtiveTempCom")
    public OkrResult<ImplementAsyncPublishAutoLockObjtiveTempComRespDto> implementAsyncPublishAutoLockObjtiveTempCom(@RequestBody @Validated ImplementAsyncPublishAutoLockObjtiveTempComReqDto reqDTO){
    return OkrResult.success(targetTempService.implementAsyncPublishAutoLockObjtiveTempCom(reqDTO));
    }
///**
//   * D3异步发布自动锁定指标模板(公共)
//   */
//    @PostMapping("implementAsyncPublishAutoLockObjtiveTempCom")
//    public OkrResult<ImplementAsyncPublishAutoLockObjtiveTempComRespDto> implementAsyncPublishAutoLockObjtiveTempCom(@RequestBody @Validated ImplementAsyncPublishAutoLockObjtiveTempComReqDto reqDTO){
//    return OkrResult.success(targetTempService.implementAsyncPublishAutoLockObjtiveTempCom(reqDTO));
//    }
}
  